package processor;

public class RiskFactor {

	
	private String riskName;
	
	private String riskLevel;
	
	private int criticality;
	
	//Used only for known risks
	private String value;

	private int result;
	
	//used only for unknown risks
	private double probabilityChange;
	
	private double deviationFromThreshold;

	public double getDeviationFromThreshold() {
		return deviationFromThreshold;
	}

	public void setDeviationFromThreshold(double deviationFromThreshold) {
		this.deviationFromThreshold = deviationFromThreshold;
	}

	public double getProbabilityChange() {
		return probabilityChange;
	}

	public void setProbabilityChange(double probability) {
		this.probabilityChange = probability;
	}


	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public void setResult(int result) {
		this.result = result;
	}

	private String reason;
	
	public String getRiskName() {
		return riskName;
	}

	public void setRiskName(String riskName) {
		this.riskName = riskName;
	}

	public String getRiskLevel() {
		return riskLevel;
	}

	public int getCriticality() {
		return criticality;
	}

	public void setRiskLevel(String riskLevel) {
		this.riskLevel = riskLevel;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public RiskFactor(String riskName, String value,String reason,int criticality, double deviationFromThreshold,
			int result) {
		super();
		this.riskName = riskName;
		this.riskLevel = getCriticality(criticality);
		this.value = value;
		this.result = result;
		this.reason = reason;
		this.criticality =  criticality;	
		this.deviationFromThreshold = deviationFromThreshold;
	}

	
	public int getResult() {
		return result;
	}
	
	
	public void setCriticality(int criticality) {
		this.criticality = criticality;
	}
	
	///////////////Constructors///////////////////
	public RiskFactor(){
		
	}
	
	public RiskFactor(int result) {
		super();
		this.result = result;
	}
	
	public RiskFactor(int result, String riskName, String reason) {
		super();
		this.riskName = riskName;
		this.result = result;
		this.reason = reason;
	}

	private String getCriticality(int number){
		if(number>=4 && number <=5){
			return "High";
		}else if(number>=2 && number <=3){
			return "Medium";
		}else{
			return "Low";
		}
	}
	
	
}
